<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of evaluation_physiographic_unit
 *
 * @author wilavel
 */
class EvaluationPhysiographicUnit extends AppModel {

    //put your code here
    var $name = "EvaluationPhysiographicUnit";
    var $actsAs = array('Logable' => array(
            'userModel' => 'User',
            'userKey' => 'user_id',
            'change' => 'full', // options are 'list' or 'full'
            'description_ids' => TRUE // options are TRUE or FALSE
            ));
    var $belongsTo = array("EvaluationAppraisal");
    var $validate = array(
        'area' => array(
            'numeric' => array(
                'rule' => 'numeric', 'required' => true, 'message' => 'Este campo es obligatorio. Debe ser un número'
            ),
        ),
        'valor_unitario' => array(
            'numeric' => array(
                'rule' => 'numeric', 'required' => true, 'message' => 'Este campo es obligatorio. Debe ser un número'
            ),
        ),
        'clase_agrologica' => array(
            'notEmpty' => array(
                'rule' => array('comparison', '!=', 'Sin registro'),
                'message' => 'Debe elegir  una clase agrológica',
            ),
        )
    );
    var $virtualFields = array('sumaArea' => 'SUM(EvaluationPhysiographicUnit.area)');

}

?>
